package com.shop.zkmall.app.controller.a;

import com.shop.zkmall.app.domain.BankParam;
import com.shop.zkmall.app.domain.CereBuyerBalanceDetail;
import com.shop.zkmall.app.domain.req.BalanceDetailReq;
import com.shop.zkmall.app.service.a.impl.CereBuyerBalanceDetailServiceImpl;
import com.shop.zkmall.app.utils.R;
import com.shop.zkmall.commons.domain.common.PageParam;
import com.shop.zkmall.commons.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@Slf4j
@RestController
@RequestMapping("balance")
@RequiredArgsConstructor
@Tag(name = "钱包模块", description = "钱包模块")
public class BalanceController {


    private final CereBuyerBalanceDetailServiceImpl cereBuyerBalanceDetail;

    /**
     * 获取用户余额
     */
    @RequestMapping(value = "getBalance")
    @Operation(summary = "获取用户余额")
    public R<BigDecimal> getBalance() {
        return cereBuyerBalanceDetail.getBalance();
    }


    /**
     * 收支明细
     */
    @RequestMapping(value = "balanceDetail")
    @Operation(summary = "收支明细")
    public R<?> balanceDetail(BalanceDetailReq param) {
        return cereBuyerBalanceDetail.balanceDetail(param);
    }
}
